let fs = require('fs');
let path = require('path');

function getLastBugStatusInStorage() {
    return new Promise((resolve, reject) => {
        fs.readFile('storage.txt', 'utf8', (err, data) => {
            resolve(data);
        })
    })
}


function setLastBugStatusInStorage(status) {
    fs.writeFile(path.resolve(__dirname ,'storage.txt'), status, function (err) {
        if (err) {
            console.log(err);
        } else {
            console.log(`最后一次轮询时间已缓存：${status}`);
        }
    });
}



module.exports = {
    getLastBugStatusInStorage,
    setLastBugStatusInStorage,
}
